<!---
Copyright: (c) 2006 The MachBlog Authors
Authors: Matt Woodward (mpwoodward@gmail.com) & Peter J. Farrell (pjf@maestropublishing.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. 
You may obtain a copy of the License at 

http://www.apache.org/licenses/LICENSE-2.0 

Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
See the License for the specific language governing permissions and 
limitations under the License.

$Id: SubscriberGateway.cfc 1191 2007-07-14 17:42:46Z pfarrell $

Notes:
--->
<cfcomponent
	displayname="SubscriberGateway"
	output="false" 
	hint="Base SubscriberGateway for MachBlog">
	
	<!---
	PROPERTIES
	--->
	<cfproperty name="datasource" type="org.machblog.datasource.Datasource" required="true" />
	
	<!---
	INITIALIZATION / CONFIGURATION
	--->
	<cffunction name="init" access="public" output="false" returntype="SubscriberGateway">
		<cfreturn this />
	</cffunction>
	
	<cffunction name="setDatasource" access="public" output="false" returntype="void"
		hint="Dependency: injected">
		<cfargument name="datasource" type="org.machblog.datasource.Datasource" required="true" />
		<cfset variables.datasource = arguments.datasource />
	</cffunction>
	<cffunction name="getDatasource" access="public" output="false" 
			returntype="org.machblog.datasource.Datasource">
		<cfreturn variables.datasource />
	</cffunction>
	
	<!---
	PUBLIC FUNCTIONS
	--->
	<cffunction name="getSubscribers" access="public" output="false" returntype="query" 
		hint="Returns a query object containing blog subscribers, optionally based on the search terms passed in">
		<cfargument name="searchText" type="string" required="false" default="" />
		<cfargument name="activeOnly" type="boolean" required="false" default="false" />
	</cffunction>
	
	<cffunction name="getSubscriptionCount" access="public" output="false" returntype="numeric" 
		hint="Returns the number of subscribers to the blog">
	</cffunction>
	
	<cffunction name="verifyBlogSubscription" access="public" output="false" returntype="boolean" 
		hint="Verifies a pending blog subscriptin and returns a boolean indicating whether or not the verification was successful">
		<cfargument name="email" type="string" required="true" />
		<cfargument name="verifyId" type="uuid" required="true" />
	</cffunction>

</cfcomponent>